<template>
  <div class="dashboard-container">
    <el-row :gutter="20">
      <!-- 数据概览卡片 -->
      <el-col :span="6" v-for="item in statistics" :key="item.title">
        <el-card shadow="hover" class="statistics-card">
          <div class="card-header">
            <span class="card-title">{{ item.title }}</span>
            <el-icon class="card-icon" :style="{ color: item.color }">
              <component :is="item.icon" />
            </el-icon>
          </div>
          <div class="card-value">{{ item.value }}</div>
          <div class="card-footer">
            <span>{{ item.desc }}</span>
          </div>
        </el-card>
      </el-col>
    </el-row>

    <!-- 欢迎信息 -->
    <el-card class="welcome-card" style="margin-top: 20px">
      <template #header>
        <div class="card-header">
          <span>欢迎使用</span>
        </div>
      </template>
      <div class="welcome-content">
        <h2>秋天云系统</h2>
        <p>欢迎使用秋天云系统管理平台</p>
      </div>
    </el-card>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { User, ShoppingCart, Tickets, Money } from '@element-plus/icons-vue'

const statistics = ref([
  {
    title: '用户总数',
    value: '1,234',
    icon: User,
    color: '#409EFF',
    desc: '总用户数'
  },
  {
    title: '订单总数',
    value: '456',
    icon: ShoppingCart,
    color: '#67C23A',
    desc: '总订单数'
  },
  {
    title: '今日订单',
    value: '89',
    icon: Tickets,
    color: '#E6A23C',
    desc: '今日新增'
  },
  {
    title: '总收入',
    value: '￥123,456',
    icon: Money,
    color: '#F56C6C',
    desc: '累计收入'
  }
])
</script>

<style scoped lang="scss">
.dashboard-container {
  padding: 20px;

  .statistics-card {
    height: 180px;
    margin-bottom: 20px;

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;

      .card-title {
        font-size: 16px;
        color: #606266;
      }

      .card-icon {
        font-size: 24px;
      }
    }

    .card-value {
      font-size: 28px;
      font-weight: bold;
      color: #303133;
      margin-bottom: 20px;
    }

    .card-footer {
      font-size: 14px;
      color: #909399;
    }
  }

  .welcome-card {
    .welcome-content {
      text-align: center;
      padding: 20px;

      h2 {
        color: #303133;
        margin-bottom: 10px;
      }

      p {
        color: #606266;
      }
    }
  }
}
</style> 